package com.ctosb.classviewer.clazz.attr;

import com.ctosb.classviewer.ClassReader;
import com.ctosb.classviewer.clazz.AbstractParse;
import com.ctosb.classviewer.clazz.Parseable;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class Exception_table extends AbstractParse {

    private short start_pc;
    private short end_pc;
    private short handler_pc;
    private short catch_type;

    @Override
    public Exception_table parse(ClassReader classReader) {
        this.start_pc = classReader.readShort();
        this.end_pc = classReader.readShort();
        this.handler_pc = classReader.readShort();
        this.catch_type = classReader.readShort();
        return this;
    }
}
